/* 充电桩应答中心合法用户认证通过信息命令*/
exports.run = (info, core, socket, logger) => {
  const reader = new core.BufferReader(info.data),
    userIdBuf = reader.read(2),
    cmdIndexBuf = reader.read(2),
    cardNumber = reader.read(16),
    customerCertificateType = reader.read(1),
    customerCertificateNumber = reader.read(20),

    acceptanceChannels = reader.read(2),
    mechanismNumber = reader.read(20),
    mechanismCode = reader.read(15),
    mechanismMember = reader.read(20),

    transactionDate = reader.read(8),
    chargingPort = reader.read(1),
    status = reader.read(1),

    authenticationCode = core.createIntBuffer(0, 8);
    logger.info(userIdBuf, cmdIndexBuf, cardNumber, status, authenticationCode);
    socket.emit(`0x7a-${userIdBuf.toString('hex')}-${cmdIndexBuf.toString('hex')}`, true);
}

